#include <alibabacloud/oss/OssClient.h>
#include <string>
using namespace AlibabaCloud::OSS;
using std::string;
struct OSSinfo{
    string EndPoint = "oss-cn-wuhan-lr.aliyuncs.com";
    string AccessKeyID = "LTAI5t6MyCDuFo6KFzYbW3dx";
    string AccessKeySecret = "3gPyzAC9nnLeyUuxaRPMpJxVT7v13j";
    string Bucket = "60niqiu-test";
};
int main(){
    InitializeSdk();
    OSSinfo info;
    ClientConfiguration conf;
    OssClient client(info.EndPoint,info.AccessKeyID,info.AccessKeySecret,conf);
    time_t expire = time(nullptr) + 600;
    auto outcome = client.GeneratePresignedUrl(info.Bucket,"newdir/1.txt",expire);
    if(outcome.isSuccess()){
        std::cout << "success url = " << outcome.result() << "\n";
    }
    else{
        std::cerr << "fail message = " << outcome.error().Message() << "\n";
    }
    ShutdownSdk();
    return 0;
}
